# Installation Steps Based on:
# http://serverfault.com/questions/332166/upgrade-subversion-1-6-to-1-7-on-centos-cant-find-yum-repository

# Reason why newer SVN version is needed
# http://serverfault.com/questions/229708/cannot-svn-checkout-on-vboxsf-mount-windows-host-ubuntu-guest

Download and Extract SVN 1.7.20 Source:
  archive.extracted:
    - name: /usr/src
    - source: http://archive.apache.org/dist/subversion/subversion-1.7.20.tar.gz
    - source_hash: http://archive.apache.org/dist/subversion/subversion-1.7.20.tar.gz.sha1
    - tar_options: v
    - archive_format: tar
    - if_missing: /usr/src/subversion-1.7.20

#TODO: Use package instead
Get Deps for SVN 1.7.20:
  cmd.run:
    - name: ./get-deps.sh
    - cwd: /usr/src/subversion-1.7.20
    - creates: 
      - /usr/src/subversion-1.7.20/apr
      - /usr/src/subversion-1.7.20/apr-util
      - /usr/src/subversion-1.7.20/neon
      - /usr/src/subversion-1.7.20/serf
      - /usr/src/subversion-1.7.20/zlib
      - /usr/src/subversion-1.7.20/sqlite-amalgamation     
    
Compile and Install SVN:
  cmd.run:
    - name: ./configure --prefix=/usr/local/subversion-1.7.20 && make && make install
    - cwd: /usr/src/subversion-1.7.20
    - creates: /usr/local/subversion-1.7.20/bin/svn
        
Make A Symlink for SVN 1.7.20 Binary at /usr/bin/svn17:
  file.symlink:
    - name: /usr/bin/svn
    - target: /usr/local/subversion-1.7.20/bin/svn
    - backupname: svn16
    - force: False
